.PHONY: build clean tool lint help

# 指定要编译的主程序文件名（不含文件扩展名）
MAIN_FILE = go-gin-example

all: version build

version:
	go version

build:
	go build -v -o ${MAIN_FILE} main.go

tool:
	 go vet . | grep -v vendor; true
	 go fmt ./...

lint:
	golint ./...

clean:
	rm -rf ${MAIN_FILE}
	go clean

help:
	@echo "make: compile packages and dependencies"
	@echo "make tool: run specified go tool"
	@echo "make lint: golint ./..."
	@echo "make clean: remove object files and cached files"